<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>bkn.bibtex.bibliography.Record</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="bkn.bibtex-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/bibkn/">bkn.bibtex</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        Package&nbsp;bkn ::
        <a href="bkn.bibtex-module.html">Package&nbsp;bibtex</a> ::
        <a href="bkn.bibtex.bibliography-module.html">Module&nbsp;bibliography</a> ::
        Class&nbsp;Record
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="bkn.bibtex.bibliography.Record-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class Record</h1><p class="nomargin-top"><span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record">source&nbsp;code</a></span></p>
<p>A single record in the dataset, usually a bibliography entry.</p>
  <p>The preferred method to access to a Record's attributes is to use 
  bracket notation, just as the built in dictionary type does, so you can 
  do:</p>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>e = Record(u<span class="py-string">'key'</span>, bibtype=u<span class="py-string">'article'</span>)
<span class="py-prompt">&gt;&gt;&gt; </span>e[u<span class="py-string">'title'</span>] = <span class="py-string">'Of Mice and Men'</span>
<span class="py-prompt">&gt;&gt;&gt; </span>e[u<span class="py-string">'title'</span>]
<span class="py-output">'Of Mice and Men'</span></pre>
  <p>An empty string will be returned if you try to access an undefined 
  attribute. Attribute names accessed and set this way are case 
  insensitive.</p>

<hr />
<div class="fields">      <p><strong>Warning:</strong>
        While the Record class does handle attribute access using the 
        bracket notation it is not a mapping object. If you need to use 
        mapping object methods you can access a Records's attribute 
        dictionary directly:
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>field_names = record.attribute_map.keys()</pre>
        <p>It is, however, important that any new keys added to the 
        dictionary in this way be lowercase, as the following example 
        illustrates:</p>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>record[u<span class="py-string">'TITLE'</span>] = <span class="py-string">'Spam'</span>
<span class="py-prompt">&gt;&gt;&gt; </span>record.fields[u<span class="py-string">'TITLE'</span>] = <span class="py-string">'Eggs'</span>
<span class="py-prompt">&gt;&gt;&gt; </span>record[u<span class="py-string">'TITLE'</span>]
<span class="py-output">'Spam'      # not eggs!</span></pre>
      </p>
</div><!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="bkn.bibtex.bibliography.Record-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">citekey</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">bibtype</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">attribute_map</span>=<span class="summary-sig-default">None</span>)</span><br />
      Initializes a new Record instance.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><code>str</code></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="bkn.bibtex.bibliography.Record-class.html#__str__" class="summary-sig-name">__str__</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns an informal string representation of this record</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.__str__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr bgcolor="#e8f0f8" >
  <th colspan="2" class="group-header"
    >&nbsp;&nbsp;&nbsp;&nbsp;Container methods</th></tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><code>object</code></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="bkn.bibtex.bibliography.Record-class.html#__getitem__" class="summary-sig-name">__getitem__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">attribute_name</span>)</span><br />
      Returns the value of an attribute.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.__getitem__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><code>None</code></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="bkn.bibtex.bibliography.Record-class.html#__setitem__" class="summary-sig-name">__setitem__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">attribute_name</span>,
        <span class="summary-sig-arg">attribute_value</span>)</span><br />
      Sets the value of an attribute.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.__setitem__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><code>None</code></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="bkn.bibtex.bibliography.Record-class.html#__delitem__" class="summary-sig-name">__delitem__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">attribute_name</span>)</span><br />
      Removes an attribute from the record.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.__delitem__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr bgcolor="#e8f0f8" >
  <th colspan="2" class="group-header"
    >&nbsp;&nbsp;&nbsp;&nbsp;Serialization methods</th></tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><code>str</code></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="bkn.bibtex.bibliography.Record-class.html#to_bibtex" class="summary-sig-name">to_bibtex</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns this record serialized as a BibTeX entry.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.to_bibtex">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr bgcolor="#e8f0f8" >
  <th colspan="2" class="group-header"
    >&nbsp;&nbsp;&nbsp;&nbsp;Information methods</th></tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="bkn.bibtex.bibliography.Record-class.html#set_parent_bib" class="summary-sig-name">set_parent_bib</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">bib</span>)</span><br />
      Sets the parent bibliography.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.set_parent_bib">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="get_parent_bib"></a><span class="summary-sig-name">get_parent_bib</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns the <a href="bkn.bibtex.bibliography.Bibliography-class.html"
      class="link">Bibliography</a> to which this record belongs.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.get_parent_bib">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><code>bool</code></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="bkn.bibtex.bibliography.Record-class.html#attribute_is_blank" class="summary-sig-name">attribute_is_blank</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">attribute_name</span>)</span><br />
      Returns True if the supplied attribute is blank.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.attribute_is_blank">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><code>list</code></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="bkn.bibtex.bibliography.Record-class.html#attribute_names" class="summary-sig-name">attribute_names</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns a list of the field names for each non-empty field in the 
      Record.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.attribute_names">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><code>str</code></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="bkn.bibtex.bibliography.Record-class.html#fullname" class="summary-sig-name">fullname</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns the name of the parent_bib and this records id, separated by 
      a colon.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.fullname">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><code>str</code></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="bkn.bibtex.bibliography.Record-class.html#global_id" class="summary-sig-name">global_id</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns the global id of this record.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.global_id">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><code>object</code></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="bkn.bibtex.bibliography.Record-class.html#names_for_sort" class="summary-sig-name">names_for_sort</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns the value of the author attribute if it exists, otherwise 
      returns the value of the editor attribute.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.names_for_sort">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><code>bool</code></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="bkn.bibtex.bibliography.Record-class.html#values_equal" class="summary-sig-name">values_equal</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">other</span>)</span><br />
      Returns true if this Record has the same content as the given Record.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.values_equal">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr bgcolor="#e8f0f8" >
  <th colspan="2" class="group-header"
    >&nbsp;&nbsp;&nbsp;&nbsp;methods for handling deprecated attributes</th></tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><code>object</code></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="bkn.bibtex.bibliography.Record-class.html#__getattr__" class="summary-sig-name">__getattr__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">name</span>)</span><br />
      Handles attribute access for deprecated attributes and methods.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.__getattr__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="bkn.bibtex.bibliography.Record-class.html#validate" class="summary-sig-name">validate</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Validates this record.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.validate">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== STATIC METHODS ==================== -->
<a name="section-StaticMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Static Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-StaticMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr bgcolor="#e8f0f8" >
  <th colspan="2" class="group-header"
    >&nbsp;&nbsp;&nbsp;&nbsp;methods for handling deprecated attributes</th></tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><code>None</code></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="bkn.bibtex.bibliography.Record-class.html#validate_attribute_name" class="summary-sig-name">validate_attribute_name</a>(<span class="summary-sig-arg">attribute_name</span>)</span><br />
      Raises a BadAttributeNameError if the supplied string is not a valid 
      attribute name.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.validate_attribute_name">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== INSTANCE VARIABLES ==================== -->
<a name="section-InstanceVariables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceVariables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><a href="bkn.bibtex.bibliography.Bibliography-class.html" 
      class="link">Bibliography</a> or <code>None</code></span>
    </td><td class="summary">
        <a name="_parent_bib"></a><span class="summary-name">_parent_bib</span><br />
      The bibliography to which this Record belongs.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="bkn.bibtex.bibliography.Record-class.html#parent_bib_id" class="summary-name">parent_bib_id</a><br />
      The id of the parent bibliography.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><code>dict</code></span>
    </td><td class="summary">
        <a href="bkn.bibtex.bibliography.Record-class.html#attribute_map" class="summary-name">attribute_map</a><br />
      A dictionary mapping attribute names to their values.
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">citekey</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">bibtype</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">attribute_map</span>=<span class="sig-default">None</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Initializes a new Record instance.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>citekey</code></strong> (str) - the local id for this record.</li>
        <li><strong class="pname"><code>bibtype</code></strong> (str) - the type attribute for this record.</li>
        <li><strong class="pname"><code>attribute_map</code></strong> (dict) - attribute name-value pairs with which to initialize this Record.</li>
    </ul></dd>
    <dt>Raises:</dt>
    <dd><ul class="nomargin-top">
        <li><code><strong class='fraise'><a href="bkn.bibtex.error.BKNBibtexError-class.html">BKNBibtexError</a></strong></code> - if an id for the record has not been specified.</li>
    </ul></dd>
  </dl>
<div class="fields">      <strong>To Do:</strong>
      <ul class="nomargin-top">
        <li>
        deprecate 'citekey' and 'bibtype' keyword arguments in favor of 'id' 
    and 'type'
        </li>
        <li>
        consider subclassing BKNBibtexError
        </li>
      </ul>
</div></td></tr></table>
</div>
<a name="__str__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__str__</span>(<span class="sig-arg">self</span>)</span>
    <br /><em class="fname">(Informal representation operator)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.__str__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Returns an informal string representation of this record</p>
  <dl class="fields">
    <dt>Returns: <code>str</code></dt>
        <dd>The current implementation calls to_bibtex(). (This may change in
          future versions.</dd>
  </dl>
</td></tr></table>
</div>
<a name="__getitem__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__getitem__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">attribute_name</span>)</span>
    <br /><em class="fname">(Indexing operator)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.__getitem__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Returns the value of an attribute. Called when using bracket 
  notation.</p>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>record[u<span class="py-string">'author'</span>]
<span class="py-more">... </span><span class="py-string">&quot;Monty Python&quot;</span>
<span class="py-prompt">&gt;&gt;&gt; </span>record[u<span class="py-string">'title'</span>]
<span class="py-more">... </span><span class="py-string">&quot;Monty Python and the Holy Grail&quot;</span></pre>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>attribute_name</code></strong> (str) - the name of the attribute whose value should be returned.</li>
    </ul></dd>
    <dt>Returns: <code>object</code></dt>
        <dd>the value of the requested attribute.</dd>
    <dt>Raises:</dt>
    <dd><ul class="nomargin-top">
        <li><code><strong class='fraise'><a href="bkn.bibtex.error.BadAttributeNameError-class.html">BadAttributeNameError</a></strong></code> - if <code>attribute_name</code> is not a valid attribute name</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="__setitem__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__setitem__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">attribute_name</span>,
        <span class="sig-arg">attribute_value</span>)</span>
    <br /><em class="fname">(Index assignment operator)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.__setitem__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Sets the value of an attribute. Called when using bracket 
  notation.</p>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>record[u<span class="py-string">'id'</span>] = <span class="py-string">'25'</span>
<span class="py-prompt">&gt;&gt;&gt; </span>record[u<span class="py-string">'type'</span>] = <span class="py-string">'article'</span></pre>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>attribute_name</code></strong> (str) - the name of the attribute whose value should be set.</li>
        <li><strong class="pname"><code>attribute_value</code></strong> (object) - the value to which the attribute should be set.</li>
    </ul></dd>
    <dt>Returns: <code>None</code></dt>
    <dt>Raises:</dt>
    <dd><ul class="nomargin-top">
        <li><code><strong class='fraise'><a href="bkn.bibtex.error.BadAttributeNameError-class.html">BadAttributeNameError</a></strong></code> - if <code>attribute_name</code> is not a valid attribute name</li>
    </ul></dd>
  </dl>
<div class="fields">      <strong>To Do:</strong>
      <ul class="nomargin-top">
        <li>
        use schema to check object attribute_value for allowed values.
        </li>
        <li>
        this method is long and confusing. it should be refactored.
        </li>
      </ul>
</div></td></tr></table>
</div>
<a name="__delitem__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__delitem__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">attribute_name</span>)</span>
    <br /><em class="fname">(Index deletion operator)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.__delitem__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Removes an attribute from the record. Called when using bracket 
  notation.</p>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">del</span> record[<span class="py-string">'issn'</span>]</pre>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>attribute_name</code></strong> (str) - the name of the attribute to be removed.</li>
    </ul></dd>
    <dt>Returns: <code>None</code></dt>
    <dt>Raises:</dt>
    <dd><ul class="nomargin-top">
        <li><code><strong class='fraise'><a href="bkn.bibtex.error.BadAttributeNameError-class.html">BadAttributeNameError</a></strong></code> - if <code>attribute_name</code> is not a valid attribute name</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="to_bibtex"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">to_bibtex</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.to_bibtex">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Returns this record serialized as a BibTeX entry.</p>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>record.to_bibtex()
<span class="py-more">... </span>&quot;@book{23,
<span class="py-more">... </span>   title = {Of Mice <span class="py-keyword">and</span> Men},
<span class="py-more">... </span>   author = {John Steinbeck}
...}</pre>
  <dl class="fields">
    <dt>Returns: <code>str</code></dt>
        <dd>the BibTeX serialization of this record. (Non-string attribute 
          values will be converted to JSON.)</dd>
  </dl>
<div class="fields">      <p><strong>Warning:</strong>
        Bibliographies with any attribute values which are not strings or 
        integers may not be serialized in the BibTeX format.
      </p>
</div></td></tr></table>
</div>
<a name="set_parent_bib"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">set_parent_bib</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">bib</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.set_parent_bib">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Sets the parent bibliography.</p>
  <p>This method also sets parent_bib_id and is prefered to setting the 
  attribute directly.</p>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="attribute_is_blank"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">attribute_is_blank</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">attribute_name</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.attribute_is_blank">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Returns True if the supplied attribute is blank.</p>
  <p>Returns True if the supplied attribute has a value of None, 
  whitespace, an empty list, or an empty dict.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>attribute_name</code></strong> (str) - the name of the attribute to check.</li>
    </ul></dd>
    <dt>Returns: <code>bool</code></dt>
  </dl>
</td></tr></table>
</div>
<a name="attribute_names"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">attribute_names</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.attribute_names">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Returns a list of the field names for each non-empty field in the 
  Record.</p>
  <dl class="fields">
    <dt>Returns: <code>list</code></dt>
        <dd>the names of all the attributes for this Record.</dd>
  </dl>
</td></tr></table>
</div>
<a name="fullname"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">fullname</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.fullname">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Returns the name of the parent_bib and this records id, separated by a
  colon.</p>
  <dl class="fields">
    <dt>Returns: <code>str</code></dt>
  </dl>
<div class="fields">      <p><strong>Deprecated:</strong>
        Use the global_id() method instead.
      </p>
</div></td></tr></table>
</div>
<a name="global_id"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">global_id</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.global_id">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Returns the global id of this record.</p>
  <dl class="fields">
    <dt>Returns: <code>str</code></dt>
        <dd>the global is of this record, i.e. the concatenation of the 
          dataset id and the local id for this record.</dd>
  </dl>
</td></tr></table>
</div>
<a name="names_for_sort"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">names_for_sort</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.names_for_sort">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Returns the value of the author attribute if it exists, otherwise 
  returns the value of the editor attribute.</p>
  <p>This method may be used when sorting bibliography entries.</p>
  <dl class="fields">
    <dt>Returns: <code>object</code></dt>
        <dd>the value of the author attribute if it exists, otherwise returns
          the value of the editor attribute.</dd>
  </dl>
<div class="fields">      <p><strong>Note:</strong>
        The returned object may be of any type but will most often be a 
        string or a list of strings.
      </p>
</div></td></tr></table>
</div>
<a name="values_equal"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">values_equal</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">other</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.values_equal">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Returns true if this Record has the same content as the given 
  Record.</p>
  <p>Distinct Records will always compare as not equal. This method may be 
  used to compare Records based upon their content.</p>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>r1 = Record(attribute_map={u<span class="py-string">'id'</span> : <span class="py-string">'1'</span>, u<span class="py-string">'title'</span> : u<span class="py-string">'Spam'</span> })
<span class="py-prompt">&gt;&gt;&gt; </span>r2 = Record(attribute_map={u<span class="py-string">'id'</span> : <span class="py-string">'1'</span>, u<span class="py-string">'title'</span> : u<span class="py-string">'Spam'</span> })
<span class="py-prompt">&gt;&gt;&gt; </span>r3 = Record(attribute_map={u<span class="py-string">'id'</span> : <span class="py-string">'1'</span>, u<span class="py-string">'title'</span> : u<span class="py-string">'Eggs'</span> })
<span class="py-prompt">&gt;&gt;&gt; </span>r1 == r2
<span class="py-more">... </span>False
<span class="py-prompt">&gt;&gt;&gt; </span>r1.values_equal(r2)
<span class="py-more">... </span>True
<span class="py-prompt">&gt;&gt;&gt; </span>r1.values_equal(r3)
<span class="py-more">... </span>False</pre>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>other</code></strong> (Record) - the Record to which this Record should be compared.</li>
    </ul></dd>
    <dt>Returns: <code>bool</code></dt>
  </dl>
</td></tr></table>
</div>
<a name="__getattr__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__getattr__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">name</span>)</span>
    <br /><em class="fname">(Qualification operator)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.__getattr__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Handles attribute access for deprecated attributes and methods.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>name</code></strong> (str) - the name of the requested attribute.</li>
    </ul></dd>
    <dt>Returns: <code>object</code></dt>
    <dt>Raises:</dt>
    <dd><ul class="nomargin-top">
        <li><code><strong class='fraise'>AttributeError</strong></code> - if this method does not handle the given attribute name.</li>
    </ul></dd>
  </dl>
<div class="fields">      <p><strong>Note:</strong>
        'attribute' in this context refers to a python attribute, not to a 
        BibJSON attribute.
      </p>
</div></td></tr></table>
</div>
<a name="validate"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">validate</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.validate">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Validates this record.</p>
  <dl class="fields">
  </dl>
<div class="fields">      <p><strong>To Do:</strong>
        add fuctionality.
      </p>
</div></td></tr></table>
</div>
<a name="validate_attribute_name"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">validate_attribute_name</span>(<span class="sig-arg">attribute_name</span>)</span>
    <br /><em class="fname">Static Method</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="bkn.bibtex.bibliography-pysrc.html#Record.validate_attribute_name">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Raises a BadAttributeNameError if the supplied string is not a valid 
  attribute name.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>attribute_name</code></strong> (<code>Unicode</code>) - a potential attribute name</li>
    </ul></dd>
    <dt>Returns: <code>None</code></dt>
    <dt>Raises:</dt>
    <dd><ul class="nomargin-top">
        <li><code><strong class='fraise'><a href="bkn.bibtex.error.BadAttributeNameError-class.html">BadAttributeNameError</a></strong></code> - if attribute_name is not a valid attribute name.</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== INSTANCE VARIABLE DETAILS ==================== -->
<a name="section-InstanceVariableDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Variable Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceVariableDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="parent_bib_id"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">parent_bib_id</h3>
  <p>The id of the parent bibliography.</p>
  <p>This will always be set when the parent bib is set, but it may 
  sometimes be useful to set this without setting the parent_bib, for 
  example, when loading the parent bib into memory might be 
  undesirable.</p>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="attribute_map"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">attribute_map</h3>
  <p>A dictionary mapping attribute names to their values.</p>
  <dl class="fields">
    <dt>Type:</dt>
      <dd><code>dict</code></dd>
  </dl>
<div class="fields">      <p><strong>Warning:</strong>
        This attribute should not be modified! New attributes may be added 
        or modified using bracket notation:
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>record[attribute_name] = value</pre>
      </p>
</div></td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="bkn.bibtex-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/bibkn/">bkn.bibtex</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Sun Jul  4 23:10:58 2010
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
